package com.stylefeng.guns.modular.flagglory.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.stylefeng.guns.common.persistence.model.Question;
import com.baomidou.mybatisplus.service.IService;
import com.stylefeng.guns.core.exception.FrontException;

import java.util.List;

/**
 * <p>
 * lg_题库 服务类
 * </p>
 *
 * @author xin123
 * @since 2018-01-30
 */
public interface IQuestionService extends IService<Question> {
    Question selectRandomQuestion(List<Integer> idList);

    Question selectRandomQuestionByCategoryId(Integer categoryId, List<Integer> idList);

    /**
     * 获取题目
     *
     * @param questionNumber 题目数量
     * @return
     * @throws FrontException
     */
    JSONArray getProportionRandomQuestionArray(Integer questionNumber) throws FrontException;

    JSONArray getRandomQuestionArray(Integer questionNumber) throws FrontException;

    JSONObject getQuestionInfo(Integer userId, Integer divisionId) throws Exception;

    JSONObject getRobotQuestionInfo(Integer userId, Integer divisionId) throws Exception;

}
